function [U, EN, ET, EW] = mMM1Q(lambda, mu, m)

%***********************************************************************************
%   \Author:    Zhanxiang Huang, zh4c@cs.virginia.edu
%   \Date:      Mar. 31, 2004
%
% Updated by Eric Humenay, ebh5n@cs.virginia.edu; Xiuduan Fang, xf4c@virginia.edu; 
% Date: Nov 20, 2006
%
%   \Brief:     mMM1Q.m calculates the mean response time and the mean waiting time
%   in a system consisting of m MM1 queues.

%   \Input:
%       \lamda: call arrival rate for the whole system
%       \mu:   1/mu is the mean service time for the whole system
%       \m:     the number of servers
%   \return:
% U: the utilization of the system
% EN: the mean number of customers in the system;
% ET: the mean response time 
% EW: the mean waiting time
%***********************************************************************************
if lambda<=0
    fprintf ('Syntax: MM1(lambda, mu)');
    error ('Bad parameter: lambda shoud be greater than 0 ');
elseif  mu<=lambda
    fprintf ('Syntax: MM1(lambda, mu)');
    error ('Bad parameter: mu should be greater than lambda to have the system stable ');
elseif (m~=ceil(m)) || (m<=0) 
    fprintf ('Syntax: erlangb(load,m)');
    error ('Bad parameter: m should be a positive integer');
end


perserverlambda = lambda/m;
perservermu = mu/m;

U = perserverlambda/pservermu;
EN = 
ET = 1/(perservermu-perserverlambda);
ET = m/(mu-lambda);
EW = ET - 1/(m*mu);
